import {getPayStatus, payInfoAPI} from "@/api/payApi";

const actions = {
    /* 获取订单支付信息的actions */
    async fetchPayInfo(context, orderId) {
        const result = await payInfoAPI(orderId)
        if (result.code !== 200) return Promise.reject("获取订单支付信息失败")
        return Promise.resolve(result)
    },

    /* 获取支付订单状态的actions */
    async fetchPayStatus(context, orderId) {
        return await getPayStatus(orderId)
    }
}
const mutations = {}
const state = () => {
    return {}
}
const getters = {}
export default {
    actions,
    mutations,
    state,
    getters,
    namespaced: true
}
